package list;

/**
 * @Auther: liwenhao
 * @Date: 2022/5/12 15:24
 * @Description:
 */
public class Test {
    public static void main(String[] args) {
        Web<String> web = new Web<>();
        web.add("网页1");
        web.add("网页2");
        web.add("网页3");
        String back = web.back(1);
        System.out.println("back = " + back);
        String forward = web.forward(1);
        System.out.println("forward = " + forward);
    }

    public static void main2(String[] args) {
        TowWayLinkList<String> list = new TowWayLinkList<>();
        list.insert(0, "网页1");
        list.insert(1, "李四");
        list.insert(2, "王五");
        list.insert(3, "赵六");
        //测试length方法
        for (String s : list) {
            System.out.println(s);
        }
        System.out.println(list.length());
        System.out.println("-------------------");
        //测试get方法
        System.out.println(list.get(2));
        System.out.println("------------------------");
        //测试remove方法
        String remove = list.remove(1);
        System.out.println(remove);
        System.out.println(list.length());
        System.out.println("----------------");

        for (String s : list) {
            System.out.println(s);
        }
    }
}
